import { ref, computed } from "vue";

const useCounter = () => {
  const count = ref(5);
  const minus = () => {
    count.value--;
    // console.log(count.value);
  };
  const add = () => {
    count.value++;
  };
  const doubleCount = computed(() => {
    return count.value * 2;
  });

  return [count, minus, add, doubleCount];
};

export default useCounter;
